package com.molichuxing.gateway.api.services;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.result.ResponseResult;
import com.molichuxing.gateway.bff.permission.entity.request.*;
import com.molichuxing.gateway.bff.permission.entity.response.*;
import com.molichuxing.services.infrastructure.dto.response.response.ResourceDto;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @Author: renzhengyu
 * @Description:
 * @Date: Created in 10:40 2019/9/9
 * @Modified By:
 **/
public interface PermissionApiService {

    /**
     * 账户登录
     *
     * @param params
     * @return
     */
    ResponseResult<AccountLoginVo> login(Map<String, Object> params);

    /**
     * 账户登出
     *
     * @return
     */
    public ResponseResult<Boolean> logOut();

    /**
     * 根据经销商id获取操作日志
     *
     * @param map
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResponseResult<Paged<OperationLogVo>> getOperationLogByDealerId(Map<String, Object> map, Integer pageNum, Integer pageSize);

    /**
     * 根据经销商id获取登陆日志
     *
     * @param map
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResponseResult<Paged<LoginLogVo>> getLoginLogByDealerId(Map<String, Object> map, Integer pageNum, Integer pageSize);

    /**
     * 根据查询条件，查询后台用户
     *
     * @param params
     * @return
     */
    ResponseResult<Paged<AccountVo>> getAccount(Map<String, Object> params, int pageNum, int pageSize);

    /**
     * 创建新用户
     *
     * @param vo
     * @return
     */
    ResponseResult<Boolean> createAccount(AccountCreateVo vo);


    /**
     * 修改用户
     *
     * @param vo
     * @return
     */
    ResponseResult<Boolean> modifyAccount(AccountModifyVo vo);

    /**
     * 重置密码
     * @param vo
     * @return
     */
    ResponseResult<Boolean> modifyResetPassword(@RequestBody AccountModifyVo vo);

    ResponseResult<List<GroupVo>> getGroupListInModifyAccountPage();

    /**
     * 根据查询条件，查询角色列表（带分页）
     * @param param
     * @param pageNum
     * @param pageSize
     * @return
     */
    public ResponseResult<Paged<GroupVo>> getGroupList(Map<String, Object> param, int pageNum, int pageSize);

    public ResponseResult<Boolean> createGroup(GroupCreateVo vo);

    public ResponseResult<Boolean> modifyGroup(GroupModifyVo vo);

    /**
     * 通过角色，获得权限树
     * @param groupId
     * @return
     */
    public ResponseResult<GroupBindResourceVo> getPermissionTree(int groupId);

    /**
     * 创建角色与权限的关联
     * @return
     */
    public ResponseResult<Boolean> createBatchGroupResource(GroupBindVo vo);

    /**
     * 获得op左侧菜单树
     * @return
     */
    public ResponseResult<List<ResourceDto>> getMenuList();

    /**
     * 修改密码
     * @param vo
     * @return
     */
    public ResponseResult<Boolean> modifyPassword(ModifyPassowrdVo vo);
}
